#include "ProcessPool.hpp"

void Usage(std::string proc)
{
    //防呆提醒
    cout<<"Usage:"<<proc<<"process-num"<<endl;
}
int main(int argc,char* argv[])
{
    if(argc != 2)
    {
        Usage(argv[0]);
        return 1;
    }
    int num = stoi(argv[1]);
    vector<Channel> channels;
    //worker函数：回调函数
    ProcessPool* pp = new ProcessPool(num, Worker);
    //初始化进程池
    pp->InitProcess();
    //派发任务
    pp->DisPatchTask();
    //退出进程池
    pp->ClearProcessPool();
    return 0;
}
